<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //先定义
        var num=22;
        //1.number 转换字符串;
        num = num.toString(); //名字 名字点。toString转换
        console.log(typeof num);
        //强制转换
        let age = String(100);
        console.log(typeof age);
        //3.prompt 接收的都是string
        let year = prompt('你好');
        console.log(typeof year);

    </script>
</body>
</html>